
import { Component } from 'react'

class App extends Component {
  state = { count: 0 }
  increament = () => {
    this.setState(prestate => ({ count: prestate.count + 1 }))
  }
  decreament = () => {
    this.setState(prestate => ({ count: prestate.count - 1 }))
  }

  render() {
    return (
      <p>
        Clicked : {this.state.count } times
        <button onClick={this.increament}>+</button>
        <button onClick={this.decreament}>-</button>
      </p>
    )
  }
}

export default App;
